<?php

/**
 * Pacientes form base class.
 *
 * @method Pacientes getObject() Returns the current form's model object
 *
 * @package    citologia
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePacientesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'tipo_documento_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tipo_Documento'), 'add_empty' => false)),
      'apellidos'         => new sfWidgetFormInputText(),
      'nombres'           => new sfWidgetFormInputText(),
      'sexo_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Sexos'), 'add_empty' => false)),
      'fechanacimiento'   => new sfWidgetFormDate(),
      'direccion'         => new sfWidgetFormInputText(),
      'telefono'          => new sfWidgetFormInputText(),
      'eps_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Eps'), 'add_empty' => false)),
      'municipio_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Municipio'), 'add_empty' => false)),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'tipo_documento_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Tipo_Documento'))),
      'apellidos'         => new sfValidatorString(array('max_length' => 45)),
      'nombres'           => new sfValidatorString(array('max_length' => 45)),
      'sexo_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Sexos'))),
      'fechanacimiento'   => new sfValidatorDate(),
      'direccion'         => new sfValidatorString(array('max_length' => 45)),
      'telefono'          => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'eps_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Eps'))),
      'municipio_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Municipio'))),
      'created_at'        => new sfValidatorDateTime(),
      'updated_at'        => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('pacientes[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Pacientes';
  }

}
